import request from '@/utils/request'

/**
 * 获取菜单列表
 */
export const getMenusListAPI = () => {
  return request({
    method: 'get',
    url: '/menus'
  })
}

/**
 * 菜单新增
 */
export const addMenusAPI = (data) => {
  return request({
    method: 'post',
    url: '/menus',
    data
  })
}

/**
 * 菜单删除
 */
export const delMenusAPI = (id) => {
  return request({
    method: 'delete',
    url: `/menus/${id}`
  })
}

/**
 * 菜单详情
 */
export const getMenusDetailAPI = (id) => {
  return request({
    method: 'get',
    url: `/menus/${id}`,
    params: {
      id
    }
  })
}

/**
 * 菜单修改
 */
export const putMenusAPI = (id, data) => {
  return request({
    method: 'put',
    url: `/menus/${id}`,
    data
  })
}
